Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cache-max-... settings for the root operation, also when it's lazy #1709

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RobinTF
Copy link
Collaborator

@RobinTF RobinTF commented Jan 14, 2025

Since #1638, QLever has the runtime parameter lazy-result-max-cache-size, with a deliberately small default value of 5 MB. However, the final result (of the root operation) should be cached not depending on that size, but depending on cache-max-size, cache-max-size-single-entry, and cache-max-num-entries, even if the last operation is (output-)lazy. This is now indeed so. Fixes #1701 (which provides a good example of a query, where the old behavior is weird and the new behavior makes much more sense).

@RobinTF RobinTF requested a review from hannahbast January 14, 2025 21:38
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.94%. Comparing base (432cd64) to head (f927206).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1709      +/-   ##
==========================================
+ Coverage   89.92%   89.94%   +0.01%     
==========================================
  Files         393      393              
  Lines       37601    37615      +14     
  Branches     4231     4232       +1     
==========================================
+ Hits        33814    33834      +20     
+ Misses       2486     2483       -3     
+ Partials     1301     1298       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hannahbast hannahbast changed the title Use different caching policy for root operation Always use cache_max_... settings for root operation, also when it's lazy Jan 15, 2025
@hannahbast hannahbast changed the title Always use cache_max_... settings for root operation, also when it's lazy Use cache_max_size... settings for the root operation, also when it's lazy Jan 15, 2025
@hannahbast hannahbast changed the title Use cache_max_size... settings for the root operation, also when it's lazy Use cache_max_size_... settings for the root operation, also when it's lazy Jan 15, 2025
@hannahbast hannahbast changed the title Use cache_max_size_... settings for the root operation, also when it's lazy Use cache-max-... settings for the root operation, also when it's lazy Jan 15, 2025
Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thanks a lot for the quick fix! I tried it with the example query from #1638, and that works fine now. I have a small question about the test coverage but that might be void.

Comment on lines +233 to +235
isRoot ? cache.getMaxSizeSingleEntry()
: std::min(RuntimeParameters().get<"lazy-result-max-cache-size">(),
cache.getMaxSizeSingleEntry());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the modified tests, isRoot is always false, so I wonder why CodeCov ist not complaining about incomplete coverage here.

@RobinTF
Copy link
Collaborator Author

RobinTF commented Jan 15, 2025

So the reason why the test coverage is fine is because there are probably dozens of tests for classes inheriting from Operation, so at least one of them explores the other code path.
That being said, as you observed correctly the existing tests don't explicitly test this new behaviour, so we definitely should add a test that tests this explicitly.

@RobinTF
Copy link
Collaborator Author

RobinTF commented Jan 24, 2025

@hannahbast I added the proper unit tests

@sparql-conformance
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If the last operation is lazy, cache the result independently of lazy-result-max-cache-size
2 participants